<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数组分割</title>
</head>
<body>
    <script>
        var arr=["aa","bb","cc","dd"];
        for(i=0;i<arr.length;i++){
            document.write(arr[i])
            if(i!=arr.length-1){
                document.write("|")
            }
        }
    </script>
</body>
</html>